const KoaRouter = require('@koa/router')
const { verifyAuthorization } = require('../middleware/login.middleware')
const orderController = require('../controller/order.controller')
const listController = require('../controller/list.controller')

const orderRouter = new KoaRouter({ prefix: '/order' })
// 创建订单接口
orderRouter.post('/' , verifyAuthorization, listController.changeListState, orderController.create)
// 支付接口
orderRouter.patch('/paid', verifyAuthorization, orderController.paid)
// 获取我的行程接口
orderRouter.get('/', verifyAuthorization, orderController.getAllTrip)
// 取消行程
orderRouter.delete('/', verifyAuthorization, orderController.cancelTrip)
module.exports = orderRouter